<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../lib/iconfont4/iconfont.css">
    <link rel="stylesheet" href="../css/login.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/idcode/js/jquery.idcode.js"></script>
    <script src="../js/layer/layer.js"></script>
</head>

<body>
    <header>
        <div class="logo_">
            <a href="#"><span class="logo_left"></span></a> <span class="logo_right"></span>
        </div>
    </header>
    <section>
        <div class="img_div">
            <a href="#"><img src="../images/login/middle.jpg" alt=""></a>
        </div>

        <!-- 右侧登录栏 -->
        <div class="form_box">
            <p class="login_img"></p>
            <form action="">
                <dl>
                    <dd>
                        <input type="text" value="" placeholder="请输入E-mail或手机号" name="uname" class="login_name">
                    </dd>
                </dl>
                <dl>
                    <dd><input type="password" value="" placeholder="请输入密码" name="upwd" class="login_password">
                    </dd>
                </dl>
                <dl>
                    <dd class="lgon_dd">
                        <input type="checkbox" name="loginSelf" class="login_self">自动登录
                    </dd>
                </dl>
                <dl>
                    <dd>
                        <button type="submit" class="loginButton">登 录</button>
                    </dd>
                </dl>
                <dl>
                    <dd>
                        <a href="#">[忘记密码?]</a><a href="./reg.html">[注册新账号]</a>
                    </dd>
                </dl>
            </form>
            <div class="partner">
                <p>使用合作网站账号登录 :</p>
                <p></p>
            </div>
        </div>
    </section>
    <footer>
        <div class="fotbox">
            <div class="firstline">
                <span class="one bgc">消费者最喜爱的网站TOP100 </span>
                <span class="line">|</span>
                <span class="two bgc">仅限18周岁以上人士购买</span>
                <span class="line">|</span>
                <span class="three bgc"><a href="#">网络社会征信网</a></span>
                <span class="line">|</span>
                <span class="four bgc">上海工商</span>
                <span class="line">|</span>
                <span>京公网安备11010502013828</span>
            </div>
            <div class="secondLine"><span>Copyright 2006-2015 也买酒 yesmywine.com 版权所有</span><span>|</span>
                <span>沪ICP备17040012号-1</span></div>
            <div class="thirdline"><a href="#"> <img src="../images/login/cert.png" alt=""> <img
                        src="../images/login/jiujiao.jpg" alt=""></a></div>
            <div><a href="#"> <img src="../images/login/link.jpg" alt=""></a></div>
        </div>
    </footer>
</body>

</html>
<script>
    $(function () {

        $('form').on("submit", function (e) {
            $.ajax({
                url: '../../sever/yemaijiuLoginServer.php',
                data: $("form").serialize(),
                type: "post",
                dataType: "json"
            }).then(function (res) {

                var showIcon = res.status == 1 ? 1 : 2;
                if (res.status == 1) {
                    layer.confirm(res.msg + ",是否前往首页",
                        {
                            icon: showIcon,
                            title: "登录提示",
                            btn: ['是的', "否"]
                        },
                        function () {
                            location = "./index.html";
                            localStorage.setItem("user", JSON.stringify(res.data))
                        }, function (index) {
                            layer.close(index)
                        })
                } else {
                    layer.confirm(res.msg + "是否重新登录", {
                        icon: showIcon,
                        title: "登录提示",
                        btn: ['是', "否"]
                    },
                        function () {
                            location = "./login.html"
                        }
                    )
                }
                ;
            })
            e.preventDefault();
        })
    })

</script>